/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ongmanager.gui.converters;

import java.text.DateFormat;
import java.text.ParseException;
import java.util.Date;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JTable;
import ongmanager.model.Ong;
import org.jdesktop.beansbinding.Converter;

/**
 *
 * @author wbettencourt
 */
public class UltimoStatusOng extends Converter<Date, String> 
{

    @Override
    public String convertForward(Date value) 
    {
        return value.toString();
    }

    @Override
    public Date convertReverse(String value) 
    {
        DateFormat formatter = DateFormat.getInstance();
        try
        {
            return formatter.parse(value);
        }
        catch (ParseException ex) 
        {
            Logger.getLogger(UltimoStatusOng.class.getName()).log(Level.SEVERE, null, ex);
        }
        return new Date();
    }
}
